#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e8+9;
// const int N = 5;
const int N = 500;
typedef long long ll;
ll triangle_numbers[maxn];
int count_divisors(int idx) {
  set<ll> s;
  ll num = triangle_numbers[idx];
  for(ll i=1; i*i<=num; ++i) {
    if(num%i==0) {
      s.insert(i);s.insert(num/i);
    }
  }
  return s.size();
}
int main() {
  for(int i=1; i<maxn; ++i)
    triangle_numbers[i] += triangle_numbers[i-1]+i;
  for(int i=1; i<maxn; ++i) {
    if(count_divisors(i) >= N) {
      cout<<triangle_numbers[i]<<endl;
      return 0;
    }
  }
}
